import service from "../serviceIndex";

// 获取聊天记录
export const getChatRecord = (params) => {
  return service({
    method: "get",
    url: `/chat/msg/getChatRecord`,
    params,
  });
};

// 保存聊天记录
export const saveChatRecord = (data) => {
  return service({
    method: "post",
    url: `/chat/msg/saveChatRecord`,
    data,
  });
};

// 获取用户的聊天列表数据（我作为商家而言）
export const getItemMsgList = (itemId) => {
  return service({
    method: "get",
    url: `/chat/msg/getChatRecordAsItem/${itemId}`,
  });
};

// 获取用户的聊天列表数据（我作为用户而言）
export const getUserMsgList = (userId) => {
  return service({
    method: "get",
    url: `/chat/msg/getChatRecordAsUser/${userId}`,
  });
};
